<template>
  <el-dialog
    :title="title"
    v-model:model-value="dialogVisible"
    width="50%"
    :close-on-press-escape="false"
    :close-on-click-modal="false"
  >
    <el-form> </el-form>

    <div slot="footer" style="text-align: center">
      <el-button @click="closeModal">取 消</el-button>
      <el-button type="primary" @click="submit">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
const props = defineProps<{
  modelValue: boolean
  tagId: number | undefined
}>()

const emit = defineEmits(['update:modelValue'])

const title = computed(() => {
  return props.tagId ? '编辑标签' : '新增标签'
})

const dialogVisible = computed({
  get() {
    return props.modelValue
  },

  set(val) {
    emit('update:modelValue', false)
  }
})

const closeModal = () => {
  dialogVisible.value = false
}
const submit = () => {
  dialogVisible.value = false
}
</script>
